3.1.6 \(\int \frac {\csc (x)}{a+a \cos (x)} \, dx\) [6]

Optimal. Leaf size=23 \[ -\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {1}{2 (a+a \cos (x))} \]

[Out]

-1/2*arctanh(cos(x))/a+1/2/(a+a*cos(x))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2746, 46, 212} \begin {gather*} \frac {1}{2 (a \cos (x)+a)}-\frac {\tanh ^{-1}(\cos (x))}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a + a*Cos[x]),x]

[Out]

-1/2*ArcTanh[Cos[x]]/a + 1/(2*(a + a*Cos[x]))

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2746

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rubi steps

\begin {align*} \int \frac {\csc (x)}{a+a \cos (x)} \, dx &=-\left (a \text {Subst}\left (\int \frac {1}{(a-x) (a+x)^2} \, dx,x,a \cos (x)\right )\right )\\ &=-\left (a \text {Subst}\left (\int \left (\frac {1}{2 a (a+x)^2}+\frac {1}{2 a \left (a^2-x^2\right )}\right ) \, dx,x,a \cos (x)\right )\right )\\ &=\frac {1}{2 (a+a \cos (x))}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,a \cos (x)\right )\\ &=-\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {1}{2 (a+a \cos (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 42, normalized size = 1.83 \begin {gather*} \frac {1-2 \cos ^2\left (\frac {x}{2}\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )}{2 a (1+\cos (x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a + a*Cos[x]),x]

[Out]

(1 - 2*Cos[x/2]^2*(Log[Cos[x/2]] - Log[Sin[x/2]]))/(2*a*(1 + Cos[x]))

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 28, normalized size = 1.22

method result size
norman \(\frac {\tan ^{2}\left (\frac {x}{2}\right )}{4 a}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{2 a}\) \(23\)
default \(\frac {\frac {\ln \left (-1+\cos \left (x \right )\right )}{4}+\frac {1}{2 \cos \left (x \right )+2}-\frac {\ln \left (\cos \left (x \right )+1\right )}{4}}{a}\) \(28\)
risch \(\frac {{\mathrm e}^{i x}}{\left ({\mathrm e}^{i x}+1\right )^{2} a}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2 a}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2 a}\) \(46\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a+a*cos(x)),x,method=_RETURNVERBOSE)

[Out]

1/a*(1/4*ln(-1+cos(x))+1/2/(cos(x)+1)-1/4*ln(cos(x)+1))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 31, normalized size = 1.35 \begin {gather*} -\frac {\log \left (\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{4 \, a} + \frac {1}{2 \, {\left (a \cos \left (x\right ) + a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*cos(x)),x, algorithm="maxima")

[Out]

-1/4*log(cos(x) + 1)/a + 1/4*log(cos(x) - 1)/a + 1/2/(a*cos(x) + a)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 37, normalized size = 1.61 \begin {gather*} -\frac {{\left (\cos \left (x\right ) + 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 2}{4 \, {\left (a \cos \left (x\right ) + a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*cos(x)),x, algorithm="fricas")

[Out]

-1/4*((cos(x) + 1)*log(1/2*cos(x) + 1/2) - (cos(x) + 1)*log(-1/2*cos(x) + 1/2) - 2)/(a*cos(x) + a)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\csc {\left (x \right )}}{\cos {\left (x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*cos(x)),x)

[Out]

Integral(csc(x)/(cos(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 34, normalized size = 1.48 \begin {gather*} -\frac {\log \left (\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {1}{2 \, a {\left (\cos \left (x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*cos(x)),x, algorithm="giac")

[Out]

-1/4*log(cos(x) + 1)/a + 1/4*log(-cos(x) + 1)/a + 1/2/(a*(cos(x) + 1))

________________________________________________________________________________________

Mupad [B]
time = 0.28, size = 20, normalized size = 0.87 \begin {gather*} \frac {1}{2\,a\,\left (\cos \left (x\right )+1\right )}-\frac {\mathrm {atanh}\left (\cos \left (x\right )\right )}{2\,a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)*(a + a*cos(x))),x)

[Out]

1/(2*a*(cos(x) + 1)) - atanh(cos(x))/(2*a)

________________________________________________________________________________________